package com.test.mchelepesa.activity_fragment_rice.base_rice;

import android.net.Uri;

import com.test.mchelepesa.activity_fragment_rice.loan_rice.LoanApplyActivity_rice;
import com.test.mchelepesa.activity_fragment_rice.login_rice.VerificationActivity;
import com.test.mchelepesa.bean_rice.process_rice.ProcessInfo_rice;
import com.test.mchelepesa.constant_rice.Constant_rice;
import com.test.mchelepesa.util_rice.helper_rice.UserInfoHelper_rice;
import com.test.mchelepesa.util_rice.http_rice.HttpManager_rice;


public abstract class BaseInfoActivity_rice extends BaseActivity_rice {

    public Uri photoUri_rice;

    private Runnable onPermissionAllPassRun_rice;

    public void onInfoUploadResponse_rice(){
        HttpManager_rice.getInstance().requestUserProcess();
    }

    @Override
    public void onUserProcessResponse_rice() {

        if (ProcessInfo_rice.getInstance().isNeedVerification()){
            UserInfoHelper_rice.getInstance().setVerificationFlag(Constant_rice.VerificationFlag_PROCESS);
            startActivityForSingleTop_rice(VerificationActivity.class);
            return;
        }

        startLoanProcess();

//        String currentStepName = ProcessInfo_rice.getInstance().getCurrentStepName();
//
//        if (TextUtils.isEmpty(currentStepName))//流程上报完毕
//            startActivity_rice(LoanApplyActivity_rice.class);
//        else {
//
//            switch (currentStepName){
//                case "ocr_info":
//                    startActivity_rice(OcrInfoActivity_rice.class);
//                    break;
//                case "sefie_info":
//                    startActivity_rice(FaceInfoActivity_rice.class);
//                    break;
//                case "account_info":
//                    if (StaticConfig_rice.isSpecialBindAccount()){
//                        startActivity_rice(BindAccountActivity_rice.class);
//                        break;
//                    }
//                default:
//                    startActivity_rice(InfoUploadActivity_rice.class);
//            }
//
//        }
//
//        finish();

    }

    public void onLoanApplyDetailResponse_rice(){
        startActivity_rice(LoanApplyActivity_rice.class);
    }

    public void setOnPermissionAllPassRun_rice(Runnable onPermissionAllPassRun_rice) {
        this.onPermissionAllPassRun_rice = onPermissionAllPassRun_rice;
    }

}
